package packets.c2spackets;

import datatypes.MCAction;
import network.MCConnection;
import exceptions.UnrecoverableException;
import packets.PacketHandler;
import world.WorldState;

/**
 * Entity Action.
 * Is sent by the client when the player performs a certain action.
 * The results of these actions seem to be only needed for visiual effects.
 */
public class P0x13 extends PacketHandler {

	public P0x13(WorldState worldstate) {
		super(worldstate);
	}

	@Override
	public void handle(MCConnection conn) throws UnrecoverableException {
		/*int eid = */conn.r.readInt();
		MCAction action = MCAction.getAction(conn.r.read());
		conn.getPlayer().setAction(action);
	}

}
